import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入姓名:");
        String name = scanner.nextLine();
        System.out.println("请输入性别");
        String sex = scanner.nextLine();
        System.out.println("请输入年龄");
        Person person = new Person();
        person.setName(name);
        int age = scanner.nextInt();
        try{
            person.setAge(age);
        }catch (AgeNotInRangeException e){
            e.printStackTrace();
        }
        try {
            person.setSex(sex);
        }catch (SexIllgealException e){
            e.printStackTrace();
        }
    }
}
